package com.examstack.portal.service;

import java.util.List;
import java.util.Map;

import com.examstack.common.domain.question.*;
import com.examstack.common.util.Page;


/**
 * @author Ocelot
 * @date 2014年6月8日 下午5:52:44
 */
public interface QuestionService {

	public Map<Integer,QuestionType> getQuestionTypeMap();
			
	public Question getQuestionByQuestionId(int questionId);

	public List<Question> getQuestionList(Page<Question> pageModel, QuestionFilter qf);

	public List<QuestionType> getQuestionTypeList();

	/**
	 * @param page
	 * @return
	 */
	public List<Tag> getTags(Page<Tag> page);
	
	public List<QuestionQueryResult> getQuestionAnalysisListByPointIdAndTypeId(
			int typeId, int pointId);
	/**
	 * 获取所有的Field
	 * @param page
	 * @return
	 */
	public List<Field> getAllField(Page<Field> page);
	
	/**
	 * 获取Field下的知识点
	 * @param fieldIdList 为null则获取所有知识点
	 * @param page
	 * @return
	 */
	public Map<Integer,KnowledgePoint> getKnowledgePointByFieldId(Page<KnowledgePoint> page, int... fieldIdList);

	public List<KnowledgePoint> getKnowledgePoint(int FieldId, Page<KnowledgePoint> page);
	
	/**
	 * 按专业获取试题
	 * @param fieldId
	 * @param page
	 * @return
	 */
	public Map<Integer,Map<Integer,List<QuestionQueryResult>>> getQuestionMapByFieldId(int fieldId,Page<QuestionQueryResult> page);
	
	/**
	 * 根据试题id获取试题清单
	 * @param idList
	 * @return
	 */
	List<QuestionQueryResult> getQuestionAnalysisListByIdList(List<Integer> idList);
	
	/**
	 * 根据fieldId,pointId分组统计试题数量
	 * @param fieldId
	 * @return
	 */
	public Map<Integer,QuestionStatistic> getQuestionStaticByFieldId(int fieldId);
	
	/**
	 * 根据fieldId,pointId,typeId分组统计试题数量
	 * @param fieldId
	 * @return
	 */
	public Map<Integer,Map<Integer,QuestionStatistic>> getTypeQuestionStaticByFieldId(int fieldId);

	/**
	 * 添加试题，同时添加试题知识点对应关系
	 *
	 * @param question
	 */
	public void addQuestion(Question question);

	/**
	 * 获取试题信息（详细）
	 * @param questionId
	 */
	public Question getQuestionDetail(int questionId, int userId);

	/**
	 * 更新试题
	 * @param question
	 * @param questionTagList
	 */
	public void updateQuestion(Question question,List<QuestionTag> questionTagList);

	/**
	 * 试题内容
	 */
	public List<QuestionQueryResult> getQuestionDescribeListByIdList(List<Integer> idList);

	/**
	 * 修改试题状态
	 * @param question
	 */
	public void updateQuestionStatus(Question question);
	/**
	 * 删除草稿试题
	 * @param question
	 */
	public void deleteByQuestionId(Question question);

	/**
	 * 添加审核记录
	 * @param checkRecord
	 */
	public void addCheckRecord(CheckRecord checkRecord);
	//统计已开放且有异议的试题数量
	public List<QuestionStatistic> getSignQuestion(int dissent,int visible);
	//检测重复试题
	public List<Question> getQuestionListByContent(String content,int fieldId);
}
